<?php

// 创建连接
$conn = new mysqli("localhost", "root", "root", "xyq");
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

$id = $_COOKIE['id'];
$name = $_GET["name"];
$text = $_GET["text"];
$pwd = $_GET["pwd"];
$color = $_GET["color"];
mysqli_query($conn, "UPDATE xyq SET `name`='$name',`color`='$color',`text`='$text',`password`='$pwd'
WHERE id='$id'");

// 跳转到index.php
header('Location: index.php');

?>